package com.docking.heylo.web.controller;

import com.docking.heylo.constant.SystemConstant;
import com.docking.heylo.service.IPostTagService;
import com.docking.heylo.utils.HeyloMessageSource;
import com.docking.heylo.web.dto.PostTagListDto;
import com.docking.heylo.web.utils.ResultUtil;
import com.docking.heylo.web.vo.BaseVo;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
@RequestMapping("/postTag")
public class PostTagController {

    @Autowired
    private HeyloMessageSource ms;

    @Autowired
    private IPostTagService postTagService;

    /***
     * 查看指定人的tag
     *
     * @return
     */
    @PostMapping("/tagForUser")
    public BaseVo tagForUser(@RequestBody PostTagListDto tagListDto){
        PageInfo<Map<String,Object>> tagList = postTagService.tagForUser(tagListDto);
        return ResultUtil.success(ms.getMessage(SystemConstant.success), tagList);
    }








}
